-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modules foundations #669
Modules foundations #669
Conversation
4fc19ce
to
3a0bf8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep going
… Only root endpoint refreshes settings (if specific option is set in config)
@@ -261,7 +261,7 @@ export const SETTINGS_MANAGER = new SettingsManager(settingsStore, { | |||
if (PRINT_CONFIG) { | |||
var withComments = Boolean(parsedArgs["with-comments"]); | |||
|
|||
SETTINGS_MANAGER.getSettings({ | |||
SETTINGS_MANAGER.getFreshSettings({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refreshSettings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refreshSettings
sound like action with some side effect, but this function is still a getter. Honestly I don't like either option.
} | ||
return Promise.race([task, timeout(timeoutMs)]) | ||
.catch(() => { | ||
this.logger.error("Settings load timeout hit, continuing"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error or warn?
put timeout value in the message, will be more descriptive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
|
||
return currentWork.then(() => this.appSettings); | ||
getSettings(opts: GetSettingsOptions = {}): Promise<AppSettings> { | ||
return this.handleSettingsTask(this.settingsLoaded, opts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why settingsLoaded is passed as argument if method could access the promise from the object field itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because in different invocation we pass decorated promise:
return this.handleSettingsTask(task, opts); |
No description provided.